﻿Imports System
Imports System.Collections.Generic
Imports System.Text
Imports System.Data
Imports System.Collections
Imports System.Windows.Forms
Imports DataObject
Imports DataObject.hDBase

Public Class BusChucDanh

    Private ChucDanhDAO As New SqlServerChucDanh
    Private oTable As New DataTable

    Public Function GetAllChucDanh(ByVal sStringConnection As String) As Object
        Try
            oTable = ChucDanhDAO.GetAllChucDanh(sStringConnection)
        Catch ex As Exception
            MessageBox.Show(ex.ToString, "Thông báo lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
        Return oTable
    End Function

    Public Sub InsertChucDanh(ByVal sStringConnection As String, ByVal oChucDanh As ChucDanh)
        Try
            ChucDanhDAO.InsertChucDanh(sStringConnection, oChucDanh)
        Catch ex As Exception
            MessageBox.Show(ex.ToString, "Thông báo lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
    End Sub

    Public Sub UpdateChucDanh(ByVal sStringConnection As String, ByVal oChucDanh As ChucDanh)
        Dim bool_ As Boolean = True
        Try
            ChucDanhDAO.UpdateChucDanh(sStringConnection, oChucDanh)
        Catch ex As Exception
            MessageBox.Show(ex.ToString, "Thông báo lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
    End Sub

    Public Sub DeleteChucDanh(ByVal sStringConnection As String, ByVal oChucDanh As ChucDanh)
        Try
            ChucDanhDAO.DeleteChucDanh(sStringConnection, oChucDanh.SoChucDanh)
        Catch ex As Exception
            MessageBox.Show(ex.ToString, "Thông báo lỗi", MessageBoxButtons.OK, MessageBoxIcon.Error)
        End Try
    End Sub

End Class
